package br.com.klis.easycontrast.model;

import java.io.Serializable;

public class Configuration implements Serializable{
	private static final long serialVersionUID = 127942300565422682L;
	private int coldTime = Constants.DEFAULT_COLD_TIME;
	private int coldTimeSec = 0;
	private int hotTime = Constants.DEFAULT_HOT_TIME;
	private int hotTimeSec = 0;
	private int repetitions = Constants.DEFAULT_REPETITIONS;
	private int startsWith = Constants.DEFAULT_STARTS_WITH;
	private boolean playSound = Constants.DEFAULT_PLAY_SOUND;
	private boolean vibrate = Constants.DEFAULT_VIBRATE;
	
	public Configuration(String hotTime, String coldTime, String repetitions, int startsWithMode, boolean playSound, boolean vibrate){
		setHotTime(hotTime);
		setColdTime(coldTime);
		setRepetitions(repetitions);
		this.startsWith = startsWithMode;
		this.playSound = playSound;
		this.vibrate = vibrate;
	}
	
	public int getColdTime() {
		return coldTime;
	}
	public void setColdTime(int coldTime) {
		this.coldTime = coldTime;
	}
	public void setColdTime(String coldTime){
		if(coldTime != null && ! coldTime.trim().equals("")){
			this.coldTime = Integer.valueOf(coldTime);
		}else{
			this.coldTime = Constants.DEFAULT_COLD_TIME;
		}
	}
	
	public int getHotTime() {
		return hotTime;
	}
	public void setHotTime(int hotTime) {
		this.hotTime = hotTime;
	}
	public void setHotTime(String hotTime){
		if(hotTime != null && ! hotTime.trim().equals("")){
			this.hotTime = Integer.valueOf(hotTime);
		}else{
			this.hotTime = Constants.DEFAULT_HOT_TIME;
		}
	}
	
	public int getColdTimeSec() {
		return coldTimeSec;
	}
	public void setColdTimeSec(int coldTimeSec) {
		this.coldTimeSec = coldTimeSec;
	}
	public int getHotTimeSec() {
		return hotTimeSec;
	}
	public void setHotTimeSec(int hotTimeSec) {
		this.hotTimeSec = hotTimeSec;
	}
	
	public int getRepetitions() {
		return repetitions;
	}
	public void setRepetitions(int repetitions) {
		this.repetitions = repetitions;
	}
	
	public void setRepetitions(String repetitions) {
		if(repetitions != null && ! repetitions.trim().equals("")){
			this.repetitions = Integer.valueOf(repetitions);
		}else{
			this.repetitions = Constants.DEFAULT_REPETITIONS;
		}
	}
	
	
	
	public int getStartsWith() {
		return startsWith;
	}
	public void setStartsWith(int startsWith) {
		this.startsWith = startsWith;
	}
	public boolean isPlaySound() {
		return playSound;
	}
	public void setPlaySound(boolean playSound) {
		this.playSound = playSound;
	}
	public boolean isVibrate() {
		return vibrate;
	}
	public void setVibrate(boolean vibrate) {
		this.vibrate = vibrate;
	}
}
